
var $ = require('../../../utils/util.js')

Page({
  data: {
    currentTab: 1, // 当前选中的tab
    tabList: [
      { name: '抢修工单', type: 1, icon: 'icon-order' }, 
      { name: '抢修回填', type: 2, icon: 'icon-tick' }
    ], // tab
    list: ['', '', '', '', ''],
    list1:[''],
    list2: [''],
    currentDate:'', // 当前的时间
    key:'', // 时间过渡的时间字段
  },

  onLoad: function (options) {

  },
  onShow: function () {

  },
  tabHanlde(e) {
    var { index } = e.detail
    this.setData({
      currentTab: index
    })
    console.log(index)
  },
  upPicsHandle(e) { // ##图片组件传出来的数据##
    var { pics, key } = e.detail
    console.log(pics, key)
  },
  openTimeHandle(e) { // 打开时间弹框
    var { key } = $.detail(e)
    console.log(key)
    this.setData({
      key,
      isShowTime: true
    })
  },
  timeConfirmHandle(e) { // 时间组件传出来的数据
    var { time, key } = e.detail
    console.log(time, key)
  },
 
  addHandle(e) { // 添加
    var {key} = $.detail(e)
    this.setData({
      [key]: [...this.data[key], '']
    })
    console.log(e)
  },
  delHandle(e) { // 删除
    var { index, key } = $.detail(e)
    var _list = this.data[key]
    _list.splice(index, 1)
    this.setData({
      [key]: _list
    })
  },

  
  onChangeCell(event) {
    this.setData({
      activeNames: event.detail
    });
  },

})